package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizServiceQuestionMapper;
import com.member.shop.domain.SysBizServiceQuestion;
import com.member.shop.service.ISysBizServiceQuestionService;

/**
 * 客服问题Service业务层处理
 *
 * @author lixinchen
 * @date 2024-10-28
 */
@Service
public class SysBizServiceQuestionServiceImpl extends ServiceImpl<SysBizServiceQuestionMapper, SysBizServiceQuestion> implements ISysBizServiceQuestionService {
    @Resource
    private SysBizServiceQuestionMapper sysBizServiceQuestionMapper;

    /**
     * 查询客服问题
     *
     * @param id 客服问题主键
     * @return 客服问题
     */
    @Override
    public SysBizServiceQuestion selectSysBizServiceQuestionById(Long id) {
        return sysBizServiceQuestionMapper.selectById(id);
    }

    /**
     * 查询客服问题列表
     *
     * @param queryWrapper 客服问题
     * @return 客服问题
     */
    @Override
    public List<SysBizServiceQuestion> selectSysBizServiceQuestionList(LambdaQueryWrapper<SysBizServiceQuestion> queryWrapper) {
        return sysBizServiceQuestionMapper.selectList(queryWrapper);
    }

    /**
     * 新增客服问题
     *
     * @param sysBizServiceQuestion 客服问题
     * @return 结果
     */
    @Override
    public int insertSysBizServiceQuestion(SysBizServiceQuestion sysBizServiceQuestion) {
        sysBizServiceQuestion.setCreateTime(DateUtils.getNowDate());
        return sysBizServiceQuestionMapper.insert(sysBizServiceQuestion);
    }

    /**
     * 修改客服问题
     *
     * @param sysBizServiceQuestion 客服问题
     * @return 结果
     */
    @Override
    public int updateSysBizServiceQuestion(SysBizServiceQuestion sysBizServiceQuestion) {
        sysBizServiceQuestion.setUpdateTime(DateUtils.getNowDate());
        return sysBizServiceQuestionMapper.updateById(sysBizServiceQuestion);
    }

    /**
     * 批量删除客服问题
     *
     * @param ids 需要删除的客服问题主键
     * @return 结果
     */
    @Override
    public int deleteSysBizServiceQuestionByIds(Long[] ids) {
        return sysBizServiceQuestionMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除客服问题信息
     *
     * @param id 客服问题主键
     * @return 结果
     */
    @Override
    public int deleteSysBizServiceQuestionById(Long id) {
        return sysBizServiceQuestionMapper.deleteById(id);
    }

    @Override
    public List<SysBizServiceQuestion> selectSysBizServiceQuestionList(SysBizServiceQuestion sysBizServiceQuestion) {
        return sysBizServiceQuestionMapper.selectSysBizServiceQuestionList(sysBizServiceQuestion);
    }
}
